<script setup lang="ts">
  const columns = [
    {
      title: '角色',
      dataIndex: 'name',
      fixed: 'left',
      width: 140,
    },
    {
      title: '文件权限',
      children: [
        {
          title: '批量上传',
          dataIndex: 'batchUpload',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: '重命名',
          dataIndex: 'rename',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: '修改',
          dataIndex: 'modify',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: '复制',
          dataIndex: 'copy',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: '移动',
          dataIndex: 'move',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: '删除',
          dataIndex: 'delete',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: '下载',
          dataIndex: 'download',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: '转发',
          dataIndex: 'forward',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: '关联',
          dataIndex: 'associate',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: '锁定',
          dataIndex: 'lock',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: '解锁',
          dataIndex: 'unlock',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: '评论',
          dataIndex: 'comment',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: '修订',
          dataIndex: 'revise',
          slotName: 'batchUpload',
          align: 'center',
        },
      ],
    },
    {
      title: '文件夹权限',
      children: [
        {
          title: ' 查询 ',
          dataIndex: 'query',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: ' 新增目录 ',
          dataIndex: 'createDirectory',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: ' 重新命名目录 ',
          dataIndex: 'renameDirectory',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: ' 文件夹移动 ',
          dataIndex: 'moveFolder',
          slotName: 'batchUpload',
          align: 'center',
        },
        {
          title: ' 删除目录 ',
          dataIndex: 'deleteDirectory',
          slotName: 'batchUpload',
          align: 'center',
        },
      ],
    },
  ];
  const data = reactive([
    {
      key: '1',
      name: 'OA 管理员',
    },
    {
      key: '2',
      name: '总账会计',
    },
    {
      key: '3',
      name: '总经理测试',
    },
  ]);
</script>

<template>
  <a-card key="角色授权" class="general-card" title="角色授权">
    <a-table
      :scroll="{ x: 2300 }"
      :columns="columns"
      :data="data"
      :width="600"
      :bordered="{ headerCell: true }"
    >
      <template #batchUpload>
        {{ record }}
        <a-checkbox value="1"></a-checkbox>
      </template>
    </a-table>
  </a-card>
</template>

<style scoped lang="less"></style>
